//
//  UIButton+SJAddition.m
//  D09美团-启动图片
//
//  Created by 周述坚 on 16/10/10.
//  Copyright © 2016年 周述坚. All rights reserved.
//

#import "UIButton+SJAddition.h"

@implementation UIButton (SJAddition)

+ (instancetype)sj_buttonWithTitle:(NSString *)title textColor:(UIColor *)color andSize:(CGFloat)fontsize
{
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    //    btn.titleLabel.text = title; 错误方式
    [btn setTitle:title forState:UIControlStateNormal];
    
    btn.titleLabel.font = [UIFont systemFontOfSize:fontsize];
    btn.titleLabel.textColor = color;
    
    return btn;
}

+ (instancetype)sj_buttonWithTitle:(NSString *)title image:(UIImage *)normalImage andHighLight:(UIImage *)highLightImage
{
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setTitle:title forState:UIControlStateNormal];
    
    [btn setImage:normalImage forState:UIControlStateNormal];
    [btn setImage:highLightImage forState:UIControlStateHighlighted];
    
    return btn;
}

+ (instancetype)sj_buttonWithTitle:(NSString *)title image:(UIImage *)normalImage andHighLight:(UIImage *)highLightImage selectedImage:(UIImage *)selectedImage{
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setTitle:title forState:UIControlStateNormal];
    [btn setImage:normalImage forState:UIControlStateNormal];
    [btn setImage:highLightImage forState:UIControlStateHighlighted];
    [btn setImage:selectedImage forState:UIControlStateSelected];
    
    return btn;


}


@end
